<template>
	<view class="ownt">
		<view class="own " v-for="(item,index) in tablist" :key="index" :class="{active:tabindex == index}" @click="tabhandel(index)">
				<view class="ownTabicon"><image :src="item.img"></image></view>
				<view>{{item.name}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"ownTabar",
		props:{
			tabindexA:{
				type:Number,
				default:0
			}
		},
		watch:{
			tabindexA(O,C){
				this.tabindex = O
			}
		},
		data() {
			return {
				
				tablist:[{
					name:'Home',
					img:'/static/tab/home-03.png'
				},{
					name:'Game',
					img:'/static/tab/diamond-01.png'
				},{
					name:'Share',
					img:'/static/tab/link-01.png'
				},{
					name:'Leaderboard',
					img:'/static/tab/list.png'
				},{
					name:'Airdrop',
					img:'/static/tab/coins-stacked-04.png'
				}],
				tabindex:0
			};
		},
		methods:{
			tabhandel(i){
				this.tabindex = i
				this.$emit('tanCilck',i)
			}
		}
	}
</script>

<style lang="scss">
	.ownt{
		width: 100%;
		position: fixed;
		bottom: 0;
		height: 70px;
		display: flex;
		background: #000;
		justify-content: space-between;
		.own{
			width: 20%;
			height: 100%;
			position: relative;
			text-align: center;
			view{
				width: 100%;
				// height: calc(160rpx - 62rpx);
				color: #fff;
				font-size: 10px;
			}
			
			.ownTabicon{
				width: 100%;
				// height: calc(160rpx - 60rpx);
				image{
					width: 24px;
					height: 24px;
					margin-top: 30rpx;
				}
			}
		}
	}
	.active::before{
		content: ' ';
		position: absolute;
		width: 100%;
		height: 2rpx;
		border-radius: 5rpx;
		top: -10rpx;
		background: #fff;
		left: 0;
	}
</style>